<?php
	/* 
		修改会员卡
	*/
	global $_W,$_GPC;	
	if($_W['role'] && $_W['isajax']){
		$mid = $_GPC['mid'];
		$name = $_GPC['name'];
		$phone = $_GPC['phone'];	
		if(!empty($mid) && !empty($name) && !empty($phone)){
			$ismcard = pdo_get('mii_ang_mcard',array('uid'=>$mid),array('id'));
			$data =  array();
			$data = array('name'=>$name,'phone'=>$phone);
			if($ismcard){
				$up = pdo_update('mii_ang_mcard',$data,array('uid'=>$mid));
				$up2 = pdo_update('mii_ang_user',array('uName'=>$name,'uPhone'=>$phone),array('uid'=>$mid));
				if($up){exit(json_encode(array('status'=>1,'msg'=>'修改成功')));}else{
					exit(json_encode(array('status'=>-1,'msg'=>'更改失败')));
				}
			}else{
				exit(json_encode(array('status'=>-1,'msg'=>'会员卡不存在')));
			}		

		}else{
			exit(json_encode(array('status'=>-1,'msg'=>'缺失必要参数')));
		}

	}else{
		exit(json_encode(array('status'=>-1,'msg'=>'没有操作权限')));
	}



?>